﻿using System.Collections;
using System.Collections.Generic;
using System.ComponentModel;
using System.Globalization;
using System.Windows.Data;

using Zuehlke.Blueprint.Quickstart.Architecture.Presentation.UserInterface.Localization;
using Zuehlke.Blueprint.Quickstart.Architecture.Presentation.UserInterface.Views;

namespace Zuehlke.Blueprint.Quickstart.Architecture.Presentation.UserInterface
{
    /// <summary>
    /// ViewModel for the shell window.
    /// </summary>
    public class ShellViewModel
    {
        #region Private Members

        private readonly List<object> _viewModels = new List<object>();

        #endregion

        #region Construction

        /// <summary>
        /// Initializes a new instance of the <see cref="ShellViewModel"/> class.
        /// </summary>
        public ShellViewModel(
            CustomersViewModel customersViewModel,
            CustomerDetailsViewModel customerDetailsViewModel,
            AboutViewModel aboutViewModel)
        {
            _viewModels.Add(customersViewModel);
            _viewModels.Add(customerDetailsViewModel);
            _viewModels.Add(aboutViewModel);

            Languages = CollectionViewSource.GetDefaultView(TranslationManager.SupportedLanguages);
        }

        #endregion

        #region Public Properties

        /// <summary>
        /// Gets the available view models.
        /// </summary>
        public IEnumerable ViewModels
        {
            get { return _viewModels; }
        }

        /// <summary>
        /// Gets or sets the languages.
        /// </summary>
        public ICollectionView Languages { get; private set; }

        #endregion
    }
}
